<template>
	<div>
	  <scroll ref="scroll" width='800' height='500' :prototype='3' background='skyblue' @backTop='scrollTo'>
		<ol style="cursor: move;">
		  <li v-for="list in this.$store.state.imgs" :key="list">
				<img :src="list" alt="" >
          </li>
		</ol>
	  </scroll>
	  <toTop ref="toTop" top='250' left="160" @click.native='toTop'></toTop>
	</div>
</template>

<script>
import scroll from '~common/scroll/scroll.vue'
// import sf from '../components/common/scroll/scroll.vue'
import toTop from '~content/toTop/toTop.vue'

export default {
	name:'Home',
	components:{
		scroll,
		toTop
	},
	methods:{
		scrollTo(position){
				if(Math.abs(position.y)>500){
					this.$refs.toTop.show()
				}
		},
		toTop(){
			var a=this.$refs.scroll.move(0,0,500)
			setTimeout(()=>{
				this.$refs.toTop.hidden()
			},300)
		}
	}
}
</script>

<style>
</style>
